#include "Model/Comment.hpp"

namespace Model
{

Comment::Comment( 
		const String& authorName, 
		const boost::posix_time::ptime& ctime /*= boost::date_time::second_clock::local_time()*/ )
		: authorName_( authorName)
		, creationTime_( ctime)
		, lastChangeTime_( ctime)
{

}

// ---------------------------------------------------------------------------------------------------------------------

Comment::Comment( const Comment& orig )
	: authorName_( orig.authorName_)
	, body_( orig.body_)
	, creationTime_( boost::date_time::second_clock< boost::posix_time::ptime>::local_time())
	, lastChangeTime_( creationTime_)
{
}

// ---------------------------------------------------------------------------------------------------------------------

Comment& Comment::operator=( const Comment& orig )
{
	if( this != &orig)
	{
		authorName_ = orig.authorName_;
		body_ = orig.body_;
		creationTime_ = orig.creationTime_;
		lastChangeTime_ = boost::date_time::second_clock< boost::posix_time::ptime>::local_time();
	}
	return *this;
}


} // namespace Model
